package lucene;

import dbutils.DBSql;
import dbutils.DataScore;


import javax.sql.DataSource;
import java.util.List;
import java.util.Map;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/7/31 23:22
 * @since JDK 1.8
 */
public class LuceneScript {

    public static void main(String[] args) throws Exception {
        create();
    }

    public static void create() throws Exception{
        Map<String, String> source= DataScore.MY_SQL();
        DBSql dbSql=new DBSql(source);
        List<Map<String, Object>> mapList=dbSql.selectMapObjList("SELECT * FROM `spring-demo`.`m_note` LIMIT 0,1000");
        LuceneUtils.addListDocumentByIndexName("mnote",mapList);
    }
}
